/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background-color: #333;
    color: white;
    padding: 10px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 表单样式 */
.login-box, .register-box {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.role-select {
    display: flex;
    gap: 20px;
    align-items: center;
}

.role-select input[type="radio"] {
    margin-right: 5px;
}

/* 按钮样式 */
.btn-login, .btn-register, .btn-search, .btn-cart, .btn-logout, .btn-checkout, .btn-back, .btn-pay, .btn-view-orders, .btn-home {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login, .btn-register, .btn-pay, .btn-checkout {
    background-color: #4CAF50;
    color: white;
    width: 100%;
}

.btn-login:hover, .btn-register:hover, .btn-pay:hover, .btn-checkout:hover {
    background-color: #45a049;
}

.btn-search {
    background-color: #2196F3;
    color: white;
}

.btn-search:hover {
    background-color: #0b7dda;
}

.btn-cart {
    background-color: #FF9800;
    color: white;
}

.btn-cart:hover {
    background-color: #e68a00;
}

.btn-logout, .btn-back {
    background-color: #f44336;
    color: white;
}

.btn-logout:hover, .btn-back:hover {
    background-color: #da190b;
}

.btn-view-orders, .btn-home {
    background-color: #607D8B;
    color: white;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-view-orders:hover, .btn-home:hover {
    background-color: #546E7A;
}

/* 链接样式 */
.register-link, .login-link {
    text-align: center;
    margin-top: 20px;
}

.register-link a, .login-link a {
    color: #2196F3;
    text-decoration: none;
}

.register-link a:hover, .login-link a:hover {
    text-decoration: underline;
}

/* 搜索栏样式 */
.search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* 菜品列表样式 */
.food-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.food-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.food-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.food-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.food-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.food-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.food-price {
    color: #f44336;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.add-to-cart {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.add-to-cart:hover {
    background-color: #45a049;
}

/* 订单标签页样式 */
.order-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.tab-btn.active {
    background-color: #2196F3;
    color: white;
    border-color: #2196F3;
}

.tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

/* 订单列表样式 */
.order-list {
    margin-top: 20px;
}

.order-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s;
}

.order-item:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.order-actions {
    display: flex;
    gap: 10px;
}

/* 订单确认页面样式 */
.order-confirm {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.order-info, .order-items, .order-total {
    margin-bottom: 20px;
}

.order-info p, .order-total h3 {
    margin-bottom: 10px;
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
}

.order-items-table th, .order-items-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.order-items-table th {
    background-color: #f2f2f2;
}

.order-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* 购物车样式 */
.cart-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.cart-item-details {
    flex: 1;
}

.cart-item-price {
    color: #f44336;
    font-weight: bold;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    padding-top: 10px;
    border-top: 2px solid #ddd;
}

/* 模态框内容居中样式 */
.modal-content h2,
.modal-content p {
    text-align: center;
    margin-bottom: 20px;
}

/* 支付成功样式 */
.success-icon {
    font-size: 60px;
    color: #4CAF50;
    text-align: center;
    margin-bottom: 20px;
}

/* 通用反馈图标样式 */
.feedback-icon {
    font-size: 60px;
    text-align: center;
    margin-bottom: 20px;
}

.feedback-icon.success {
    color: #4CAF50;
}

.feedback-icon.error {
    color: #f44336;
}

.feedback-icon.info {
    color: #2196F3;
}

/* 模态框按钮居中样式 */
.btn-view-orders {
    display: block;
    margin: 20px auto 0;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn-view-orders:hover {
    background-color: #45a049;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .food-items {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
    
    .order-actions {
        flex-direction: column;
    }
    
    .order-actions button {
        width: 100%;
    }
}